<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    var user = {
        name:'YANG',
        age:22,
    }

    // 正常打印
    console.log(user.name,user.age)

    //利用解构赋值方式简化
    const {name,age} = user
    console.log(name,age)

    //温馨提示：对象的属性没有次序，变量必须与属性同名，才能取到正确的值

    //对象的解构赋值，可以很方便地将现有对象的方法，赋值到某个变量
    const {log} = console
    log('hello')

</script>